#include <iostream>
#include <algorithm>
using namespace std;

signed main()
{
    int n,a[100005];
    cin>>n;
    for(int i=0;i<n;i++)    cin>>a[i];
    sort(a,a+n);
    for(int i=1;i<n;i++){
        if(a[i]-a[i-1]>1&&a[i]>1){
            if(a[i-1]<=0)    cout<<1;
            else    cout<<a[i-1]+1;
            return 0;
        }
    }
    if(a[n-1]<=0)    cout<<1;
    else    cout<<a[n-1]+1;
    return 0;
}
